package server.networking;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.ArrayList;

import model.Player;
import model.Table;
import model.TableInformation;
import model.TableSettings;
import model.user.User;
import model.user.UserSettings;
import client.networking.ClientCallbackInterface;

public interface ServerRemoteInterface extends Remote {
	public void addClient(String username, ClientCallbackInterface c) throws RemoteException;
	public void removeClient(String username) throws RemoteException;
	
	public void createAccount(String username, String Password, UserSettings userSettings) throws RemoteException;
	public User login(String username, String password) throws RemoteException, SQLException;
	public void logout(String username) throws RemoteException;
	public int createTable(TableSettings tableSettings) throws RemoteException;
	public int joinTable(User u, int tableID, int chips) throws RemoteException;
	public void leaveTable(Player player, int tableID) throws RemoteException;
	public User modifyUsername(User user, String newUsername) throws RemoteException;
	public ArrayList<Integer> getTableIDs() throws RemoteException;
	public int getTableFreeSlots(int i) throws RemoteException;
	public User modifyPassword(User user, String oldPass, String newPass) throws RemoteException;
	public User changePersonalInfo(User user, String firstName, String lastName, String age, String gender, String location) throws RemoteException;
	public int getMaxTables() throws RemoteException;
	public int getNumTables() throws RemoteException;
	public TableSettings getTableSettings(int tableID) throws RemoteException;
	
	// In-game methods
	public void startFirstStreet(int tableID)throws RemoteException;
	public void startNextStreet(int tableID)throws RemoteException;
	public void endRound(int tableID)throws RemoteException;
	public void determineFirstBetter(int tableID, boolean firstRound) throws RemoteException;
	public void call(int tableID) throws RemoteException;
	public void raise(int tableID, int bet) throws RemoteException;
	public void allIn(int tableID) throws RemoteException;
	public void fold(int tableID) throws RemoteException;
	public int getCurrentBet(int tableID) throws RemoteException;
	public void addPlayerToTable(int tableID, String username, int chips) throws RemoteException;
	public String getPlayerAt(int tableID, int seat) throws RemoteException;
	public void removePlayerFromTable(int tableID, String username, int chipsWithdrawn) throws RemoteException;
	public TableInformation getTableInformation(int tableID, String username) throws RemoteException;
	public void sendMessage(int tableID, String username, String text) throws RemoteException;
	public ArrayList<String> getMessages(int tableID) throws RemoteException;
}
